package yunjiao.javatutorials.designpatterns.visitor.example2.items;

import lombok.Data;
import yunjiao.javatutorials.designpatterns.visitor.example2.ShopVisitor;

/**
 * TODO
 *
 * @author yangyunjiao
 */
@Data
public class Electronics implements ShopItem {
    private String brand;
    private double price;

    public Electronics(String brand, double price) {
        this.brand = brand;
        this.price = price;
    }

    @Override
    public String getName() {
        return getBrand();
    }

    @Override
    public double getWeight() {
        return 0.0d;
    }

    @Override
    public ShopItemCategory getCategory() {
        return ShopItemCategory.ELECTRONICS;
    }

    @Override
    public double accept(ShopVisitor visitor) {
        return visitor.visit(this);
    }

    @Override
    public String toString() {
        return "Electronics [brand=" + brand +
                ", price=" + price +
                "]";

    }
}
